<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% String path = pageContext.getServletContext().getContextPath();%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>挂号-病人列表</title>
<link href="<%=path %>/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<link href="<%=path %>/bootstrap/bootstrap-3.3.7-dist/css/bashboard.css" rel="stylesheet">
<link href="<%=path %>/bootstrap/bootstrap-validator/dist/css/bootstrapValidator.min.css" rel="stylesheet">
	
<script type="text/javascript" src="<%=path %>/bootstrap/bootstrap-3.3.7-dist/js/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="<%=path %>/bootstrap/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="<%=path %>/bootstrap/bootstrap-validator/dist/js/bootstrapValidator.min.js"></script>
 
   <script type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
<style>
	   body{font-family:"微软雅黑";padding-top:10px;margin:0px;}
	   .labelField{width:130px;}
	   .form-group{padding-bottom:15px;padding-left:20px;}
	   .dropul li{float:left; width:460px;}
	   .dropul{width:460px;height:200px;overflow:auto;}
	   .dropDown_title span{display:block;width:150px;float:left;border-bottom:solid 1px #ccc; text-align:center;font-weight:bold;}
	   .dropDown_rows span{display:block;width:150px;float:left;border-bottom:solid 1px #ccc;   }
	</style>

	  <script type="text/javascript">
	    function patientSelected(){
	      if($("input:radio[name='patient_idcard']:checked").get().length<=0){//get()表示将获取一组元素对象，转为数组
	         alert("请选择一个患者信息！");
	         return;
	      }
	      //jquery中的选择器，选择 被选中的单选框 input:radio 表示按照input标签名获取元素，再次过滤，找type=‘radio’的一组元素；
	     var patient_idcard= $("input:radio[name='patient_idcard']:checked").val();
	     alert(patient_idcard);
	     //提交请求，按照患者id查询病人信息
	     window.location.href="<%=path%>/opreg/selectPatientById?patient_idcard="+patient_idcard;
	     window.event.returnValue=false;
	     return false; 
	    }
	  </script>

</head>
<body>
  <!-- EL表达式和JSTL标签库 
       EL表达式用于简化JSP
  -->


            <%--  <% List<PatientinfoEntity> list=(List<PatientinfoEntity>)request.getAttribute("rows");%> --%>
			<!--toolsbar-->
			<div class="panel panel-default">
			 
	        <div class="panel-body">
	                <a     class="btn btn-primary" href="javascript:void(0);" onclick="return patientSelected()">确定选择患者</a>
	                <!-- <input type="button"  onclick="return patientSelected()" value="确定患者"> -->
	                 
				     <input type="button" class="btn btn-primary" value="注册病人" 
				     onclick="window.location.href=' <%=path%>/opreg/patientList';" >
				
  					<!-- 日结账单明细-->
				   <table class="table table-striped">
			                   <tbody>
									<tr>
										 <th>序号</th><th>选择</th><th>姓名</th><th>身份证号码</th><th>年龄</th><th>性别</th> 
										 
			 						</tr>
			 						 
			 						 <c:forEach items="${rows}" var="patient" varStatus="i">
			 						   <tr>
			 						      <td>${i.count}</td>
			 						      <td>
			 						      <input type="radio" name="patient_idcard" value="${patient.patient_idcard}">
			 						      </td>
			 						      <td>${patient.patient_name}</td>
			 						       <td>${patient.patient_idcard}</td>
			 						       <td>${patient.patient_age}</td>
			 						        <td>
			 						          <c:if test="${patient.patient_sex==1}">男</c:if>
			 						           <c:if test="${patient.patient_sex==0}">女</c:if>
			 						        </td>
			 						   </tr>
			 						 </c:forEach>
			 						 
			 						<%-- <%for(int i=0;i<list.size();i++){
			 						   PatientinfoEntity e=list.get(i);
			 						%>
			 						<tr>
										<td>
										<%=i %>
										</td>
										<td> 
										<%=e.getName() %>
					    				</td>
					    				<td>
					    				 <%=e.getIdnumber() %>
					    				</td> 
					    				<td>
					    				<%=e.getAge() %>
					    				</td>	 
									</tr>
									  						
			 						<% 
			 						} %> --%>
									
										 
										 
									 
									 
							   </tbody>	
              	   </table>
		    </div>
		   </div>
		   
		   
		  
 
  </body>

</html>
